package msu.ml.data;
import weka.core.*;

/**
 * A Classification Rule is used to choose a class from
 * a probability distribution representing the probability
 * that an instance is a member of a candidate class. Although
 * a majority wins rule is most often used, there are many other
 * rules that might perform better in a certain context.
 *
 * @author Reginald M Mead
 * @version 1.0
 *
 * @see ThresholdRule
 * @see MajorityRule
 */
public abstract class ClassificationRule 
{
	/**
	 * return a class for the given distribution
	 *
	 * @param distribution probability distribution for potential classes
	 * @return chosen class
	 */
	public abstract int getClassFromDistribution(double [] distribution);

	/**
	 * return a class for the given frequencies
	 *
	 * @param frequencies frequencies for potential classes
	 * @return chosen class
	 */
	public abstract int getClassFromDistribution(int [] frequencies);

}
